<?php
$operations = Blyn::app()->getActiveApp()->getOperations(array('user' => Blyn::app()->getCurrentUser()));

$items = array();

foreach ($operations as $id => $opp) {
    $menuStr = Yii::t('site', $opp->getName(BEntity::Name_DisplayName));
    
    if ($opp->getName(BEntity::Name_DisplayName) != "joinSpace") {
        $item = array();
        $item['url'] = $opp->getUIManager()->getAjaxLink($menuStr);
//        $item['url'] = $opp->getUIManager()->getAjaxLink($opp->getName(BEntity::Name_DisplayName));
        //$item['url'] = $opp->getUIManager()->getUrl();
        $item['label'] = $opp->getName($menuStr);
//        $item['label'] = $opp->getName(BEntity::Name_DisplayName);
        $item['active'] = '';
        //$item['active'] = FALSE;

        $activeOperation = Blyn::app()->getActiveOperation();

        if ($activeOperation instanceof BOperation && $opp->getId() == $activeOperation->getId())
            $item['active'] = 'active';
        // $item['active'] = TRUE;

        array_push($items, $item);
    }
}
?>
<div class="container">
    <ul class="nav nav-tabs blue-backgroud-link" style="margin-bottom: 0;margin-top: 30px">
        <?php foreach ($items as $item) { ?>
            <li class=<?php echo $item['active']; ?>>
                <?php echo $item['url']; ?>
            </li>  
        <?php } ?>
    </ul>
</div>


<?php
/*
  $this->widget('bootstrap.widgets.TbMenu', array(
  'type' => 'pills', // '', 'tabs', 'pills' (or 'list')
  'stacked' => false, // whether this is a stacked menu
  'items' => $items
  ));
 * 
 */
?>

